package org.siam.impl.data.rendering {
	
	import mx.core.IFactory;
	
	import org.siam.core.data.rendering.IRenderingManager;
	import org.siam.core.data.rendering.IRenderingManagerFactory;
	import org.siam.impl.common.RegistryFactory;
	import org.siam.impl.common.XMLFactory;

	public class RenderingManagerFactory extends XMLFactory implements IRenderingManagerFactory {
		
		public function RenderingManagerFactory(input:XML) {
			super(input);
		}
		
		public function newInstance():IRenderingManager {
			var instance:RenderingManager = new RenderingManager();
			if (input) {
				new RegistryFactory(input, RegistryFactory.UICOMPONENT_CLASS, "renderer",
					function(id:String):Boolean {
						return instance.hasRenderer(id);
					},
					function(id:String, factory:IFactory):void {
						instance.registerRenderer(id, factory); 
					}).parseInput();
			}
			return instance;
		}
	}
}